﻿@using rossisdead.Mvc.Detergent
@using DetergentDemoSite.Models
@model AnimalViewModel

@{
    ViewBag.Title = "Index";
    var animalTypes = new List<SelectListItem>();
    animalTypes.Add(new SelectListItem {Value = "", Text = "Select"});
    animalTypes.Add(new SelectListItem { Value = ((int)AnimalTypes.Adorable).ToString(), Text = AnimalTypes.Adorable.ToString() });
    animalTypes.Add(new SelectListItem { Value = ((int)AnimalTypes.NotSoAdorable).ToString(), Text = AnimalTypes.NotSoAdorable.ToString() });
}


<table>
    <tr>
        <td>Animal Type: </td>
        <td>@Html.DropDownListFor(m => m.SelectedAnimalType, animalTypes)</td>
    </tr>
    <tr>
        <td>Animal</td>
        <td>@Html.EditorFor(m => m.SelectedAnimalId, new { Container = @Model})</td>
    </tr>
    <tr>
        <td>Animal</td>
        <td>@Html.CascadingDropDownFor(m => m.SelectedAnimalId)</td>
    </tr>

</table>